#!/usr/bin/env node

const { spawn } = require("child_process");
const path = require("path");

console.log("🚀 启动开发服务器...");
console.log("📝 热加载已启用");
console.log("🌐 访问地址: http://localhost:3000");

const child = spawn("npm", ["run", "dev"], {
	stdio: "inherit",
	shell: true,
	cwd: __dirname,
});

child.on("error", (error) => {
	console.error("❌ 启动失败:", error);
	process.exit(1);
});

child.on("close", (code) => {
	console.log(`开发服务器已退出，退出码: ${code}`);
});
